Skip to content

chore: add helm tests and update ci to check for changes#204

Merged
rowansmithau merged 3 commits into
mainfrom
rowan/helm_test_addition
Jun 23, 2026
Merged

chore: add helm tests and update ci to check for changes#204
rowansmithau merged 3 commits into
mainfrom
rowan/helm_test_addition

Conversation

@rowansmithau

@rowansmithau rowansmithau commented Jun 22, 2026

Copy link
Copy Markdown
Member
  1. update ci.yaml to add helm-test
    1.1. this runs a modified version of chart_test.go from coder/coder
    1.2. I also bought in check_unstaged to help with drift detection
  2. created helm test files
  3. generated the goldens

chart_test.go diff:

coder@white-meadowlark-38:~$ git diff coder/helm/coder/tests/chart_test.go coder-logstream-kube/helm/tests/chart_test.go
diff --git a/coder/helm/coder/tests/chart_test.go b/coder-logstream-kube/helm/tests/chart_test.go
index 48e03de..62179de 100644
--- a/coder/helm/coder/tests/chart_test.go
+++ b/coder-logstream-kube/helm/tests/chart_test.go
@@ -11,8 +11,6 @@ import (
 
        "github.com/stretchr/testify/require"
        "golang.org/x/xerrors"
-
-       "github.com/coder/coder/v2/testutil"
 )

...
test files names were updated
...

@@ -177,12 +115,14 @@ func (tc testCase) goldenFilePath() string {
        return filepath.Join("./testdata", tc.name+"_"+tc.namespace+".golden")
 }
 
+func inCI() bool { return os.Getenv("CI") != "" }
+
 func TestRenderChart(t *testing.T) {
        t.Parallel()
        if *updateGoldenFiles {
                t.Skip("Golden files are being updated. Skipping test.")
        }
-       if testutil.InCI() {
+       if inCI() {
                switch runtime.GOOS {

@rowansmithau rowansmithau self-assigned this Jun 22, 2026
@rowansmithau rowansmithau added the github_actions Pull requests that update GitHub Actions code label Jun 22, 2026
@rowansmithau rowansmithau marked this pull request as ready for review June 22, 2026 03:28

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! I would venture that we might not need all of the test cases from coder. Since this chart is much less complex, we could probably get by with two test cases: one for defaults, and one with everything overridden from the default.

@rowansmithau rowansmithau merged commit 9da798c into main Jun 23, 2026
5 checks passed
@rowansmithau rowansmithau deleted the rowan/helm_test_addition branch June 23, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants